package hilos;

public class ConfigurarHilo {

    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Hilo());
        Thread t2 = new Thread(new Hilo());
        Thread t3 = new Thread(new Hilo());

        t1.setPriority(Thread.NORM_PRIORITY);
        t2.setPriority(Thread.NORM_PRIORITY);
        t3.setPriority(Thread.NORM_PRIORITY);

        t1.setDaemon(false);
        t2.setDaemon(false);
        t3.setDaemon(false);

        t1.setName("hilo 1");
        t2.setName("hilo 2");
        t3.setName("hilo 3");


        t1.start();
        t2.start();
        t3.start();
        
        Thread.currentThread().sleep(1000);
    }

    static class Hilo implements Runnable {
        
        public void run() {
            Thread t = Thread.currentThread();
            for (int i = 0; i < 1000000; i++) {
                System.out.println(this + " " + t.getName() + "----" + i);
            }
        }
    }
}
